#ifndef TRIANGLE_H
#define TRIANGLE_H

#include <list>
#include <vector>
#include "globals.h"
#include "rtcore/rtcore.h"
namespace gemren
{

	struct triangle
	{
		typedef embree::Vec3f coord;
		triangle          (const size_t v0_, const size_t v1_, const size_t v2_, material_ptr inmat, material_ptr outmat = 0);
		void set_normals  (const size_t n0_, const size_t n1_, const size_t n2_);
		void set_texcoords(const size_t t0_, const size_t t1_, const size_t t2_);
		//int paircnt, hitcnt;
		size_t v0, v1, v2;	//vertices
		size_t n0, n1, n2;	//normals
		size_t t0, t1, t2;	//texture coords
		char datatype;		//
		coord normal;
		material_ptr insidemat, outsidemat; //in & out material for refraction index, (-1) - unknown mat, 0 - air
		//bool use_direct_light;
		float area(const scene* s) const;
		typedef std::vector<size_t> path_t;
		typedef std::vector<path_t> pathvec_t;
	};
	//embree::BuildTriangle& operator =(embree::BuildTriangle& bt, const triangle
}
#endif
